package com.zc.portal.infra.security.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//@Configuration
public class GlobalWebMvcConfig implements WebMvcConfigurer {

    /**
     * @param registry
     * @description 跨域全局处理
     */
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/layuiadmin/*")
                .allowedHeaders("*")
                .allowedOrigins("http://localhost:9083", "http://localhost:9084")
                .allowedMethods("GET");
    }
}
